package com.coincalf.chan.feign;

import com.coincalf.chan.feign.hystrix.MessagingServiceClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author qiang
 */
@FeignClient(value = "coincalf-chan-service", fallback = MessagingServiceClientFallback.class)
public interface MessagingServiceClient {

    @RequestMapping(value = "/v3/messaging/convertAndSendToGroup", method = RequestMethod.POST)
    void convertAndSendToGroup(@RequestParam("channel") String channel, @RequestParam("body") String body);

    @RequestMapping(value = "/v3/messaging/convertAndSendToUser", method = RequestMethod.POST)
    boolean convertAndSendToUser(@RequestParam("channel") String channel, @RequestParam("userId") String userId, @RequestParam("body") String body);
}